home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / rpl489.doc < prev    next >
Text File  |  1995-03-31  |  66KB  |  1,848 lines

  1.  
  2.                           Magic48ges presents: 
  3.  
  4.  
  5.                      ûûûûû  ûûûûû  û       û   ûûû 
  6.                       û   û  û   û û      ûû  û   û 
  7.                       û   û  û   û û     û û  û   û 
  8.                       ûûûû   ûûûû  û    û  û   ûûû 
  9.                       û û    û     û    ûûûûû û   û 
  10.                       û  û   û     û       û  û   û 
  11.                       û   û  û     ûûûû    û   ûûû 
  12.  
  13.  
  14.  
  15.              A SYSTEM-RPL DEVELOPMENT TOOLKIT FOR THE HP48 
  16.  
  17.  
  18.                               Version 2.02 
  19.  
  20.  
  21.        (c) 1993 by Detlef Mueller & Raymond Hellstern, Magic48ges 
  22.  
  23.  
  24. CONTENTS 
  25. íííííííí 
  26.  
  27.  
  28. 1. Introduction 
  29.     1.1 Copyrights & Acknowledgements 
  30.     1.2 The RPL48 Toolkit 
  31.     1.3 Requirements & Installation Instructions 
  32.     1.4 Abbreviations 
  33.  
  34. 2. <-RPL-> Library 
  35.     2.1    Overview 
  36.     2.2    The System-RPL Compiler/Decompiler 
  37.     2.3    The Saturn Assembler/Disassembler 
  38.     2.3.1 The Assembler Parameter Field Parser 
  39.     2.4    The Reference Table 
  40.     2.5    Command Reference 
  41.     2.6    Hooks 
  42.     2.7    Things to Notice 
  43.  
  44. 3. <-LIB-> Library 
  45.     3.1 Overview 
  46.     3.2 Control Variables 
  47.     3.3 Command Reference 
  48.     3.4 Things to Notice 
  49.  
  50. Appendix A - Quick Reference Guides 
  51.     A.1 <-RPL-> 
  52.     A.1.1 Commands 
  53.     A.1.2 Flag Usage 
  54.     A.1.3 Error Messages 
  55.     A.2 <-LIB-> 
  56.     A.2.1 Commands 
  57.     A.2.2 Flag Usage 
  58.     A.2.3 Error Messages 
  59.  
  60. Appendix B - A ->COD Example 
  61.  
  62. Appendix C - Ordering Information 
  63.  
  64.  
  65. 1. Introduction 
  66. ííííííííííííííí 
  67.  
  68.  
  69. 1.1 Copyrights & Acknowledgements 
  70. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  71.  
  72. All files of the RPL48 toolkit are copyrighted (c) by Detlef Mueller and 
  73. Raymond Hellstern - Magic48ges, 1991-1993 - unless otherwise noted. 
  74.  
  75. The RPL48 package is distributed in the hope that it will be useful, but 
  76. RPL48 is provided 'as is,' and is subject to change without notice. 
  77. D. Mueller and R. Hellstern make no warranty of any kind with regard to 
  78. the software or documentation, including, but not limited to, the implied 
  79. warranties of merchantability and fitness for a particular purpose. 
  80. D. Mueller and R.Hellstern shall not be liable for any error or for 
  81. incidental or consequential damages in connection with the furnishing, 
  82. performance, or use of this software and documentation. 
  83.  
  84. This version of RPL48 is a GiftWare release. You may use it as long as you 
  85. like without registration, but only for developing non-commercial software. 
  86.  
  87. Permission to copy the whole, unmodified RPL48 package is granted provided 
  88. that the copies are not made or distributed for resale (excepting nominal 
  89. copying fees). If you want to get your own, brand new version, and for further 
  90. information, please refer to Appendix C. 
  91.  
  92. It should be impossible to crash your '48 by using RPL48, but be warned: 
  93. no software is bug free ! 
  94.  
  95. We would like to thank the following people for their support: 
  96.  
  97.   Wlodek Mier-Jedrzejowicz    for presenting RPL48 to the world. 
  98.   Rick Grevelle            for the HACKIT library, the ->DIR command of 
  99.                                 <-LIB->, the base of the sys-stack, many 
  100.                                 suggestions, exiting talks and for sending 
  101.                                 us an HP48GX. 
  102.   Mika Heiskanen        for beta testing, lots of suggestions, MKROM, 
  103.                                 DEBUG, and for a great performance enhancement 
  104.                                 of the D->LIB and L->DIR commands. 
  105.   Douglas R. Cannon        for beta testing, lots of suggestions, and 
  106.                   for reviewing this document. 
  107.   Joseph K. Horn        for beta testing and suggestions, the `HP 48 
  108.                                 Resource Allocation Guideline; Library ID's`, 
  109.                                 SORTLS and for maintaining the '48 GDs. 
  110.   Carlos Ferraro        for beta testing and his friendship. 
  111.   Simone Rapisarda        for beta testing and many suggestions. 
  112.   Fatri Mohamed, 
  113.   Romain Desplats, 
  114.   Georg Hoppen            for suggestions and beta testing. 
  115.   James H. Cloos, 
  116.   Steve VanDevender, 
  117.   Chris Maksymiak        for suggestions. 
  118.   Jeoff Krontz,            for suggestions, beta testing, getting another 
  119.                   GX for Raymond, exiting talks, and.. 
  120.   Chris Spell            ..for maintaining the '48 archive at 
  121.                                 seq.uncwil.edu and for moderating 
  122.                                 comp.sources.hp48. 
  123.   Dennis York            for the kindly permission to publish the BNF 
  124.                                 parser generator example. 
  125.   W.C.Wickes & HP Corvallis    for the '48 and the RPL tools. 
  126.  
  127.  
  128. 1.2 The RPL48 Toolkit 
  129. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  130.  
  131. The RPL48 Toolkit provides more than 50 powerful commands to aid system RPL 
  132. and assembler programming and library development on a HP48. It consists of 
  133. three parts: 
  134.  
  135.     * library 1234, <-RPL->:5.00 - contains a sys-RPL compiler/decompiler 
  136.       and Saturn assembler/disassembler. 
  137.  
  138.     * library 1221, <-LIB->:2.0 - contains a library creator/splitter and 
  139.       many commands for handling libraries and un-/supported objects. 
  140.  
  141.     * a reference table which contains address/name pairs of ROM entry 
  142.       points. 
  143.  
  144. The main commands of RPL48 are modeled after the MesS-DOS programs RPLCOMP. 
  145. EXE, SASM.EXE and USRLIB.EXE which are provided by HP in the self extracting 
  146. archive TOOLS.EXE (available on several ftp sites and GD#4). This document 
  147. describes the interface to RPL48; it is not a sys-RPL or Saturn assembler 
  148. manual. Please refer to RPLMAN.DOC, RPLCOMP.DOC, USRLIB.DOC and SASM.DOC 
  149. (all contained in TOOLS.EXE) for learning and/or reference purposes. 
  150.  
  151. We assume that you are familar with the fundamentals of sys-RPL, Saturn 
  152. assembly and libraries. 
  153.  
  154.  
  155. 1.3 Requirements & Installation Instructions 
  156. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  157.  
  158. RPL48 should work on ROM versions A-M HP48 - it's tested on rev A, E, L, M 
  159. machines by the authors, and it's reported to run also on rev D and J. 
  160.  
  161. The <-RPL-> library is compiled to a fixed address; it MUST be stored in an 
  162. independent (FREEd) port (ie. it only works on a SX or GX), on a SX this can 
  163. be either port 1 or 2, on a GX this must be port 1 ! 
  164.  
  165. Because the whole RPL48 kit requires ~60kb of memory (including a reference 
  166. table made from the latest entries released by HP) it is recommended to store 
  167. it into a 128k RAM card. The <-LIB-> library was developed using the standard 
  168. methods, it can be stored and used in port 0 on any HP48; on a GX it's 
  169. limited to the ports 0 and 1, and must not be installed in the ports 2-33. 
  170.  
  171. For a complete installation of RPL48 it is neccessary that you have plugged 
  172. in a 128k RAM card (which must have ~60kb free space) in either port 1 or 2 
  173. of your SX, port 1 of your GX; the card must be set to R/W. Proceed as 
  174. follows: 
  175.  
  176.     a) remove all files of an earlier version 
  177.  
  178.     b) merge the port 
  179.  
  180.     c) set up RPL.TAB on your computer by renaming one of the two shipped 
  181.        reference tables or by creating an own one (see section '2.4 The 
  182.        Reference Table') 
  183.  
  184.     d) download RPL.TAB, LIB.LIB and RPL.LIB 
  185.  
  186.     e) recall RPL.TAB to the stack, purge RPL.TAB and store it as a backup 
  187.        object named RPL.TAB (case sensitive !) into port 0 (:0:RPL.TAB STO) 
  188.  
  189.     f) recall the two libraries, purge the variables containing the original 
  190.        copies and store the libraries into port 0 (two times 0 STO) 
  191.  
  192.     g) free the port, make sure that :0:1234 is the 1st entry of the list 
  193.        in level 2 for the FREE command ! (you can use 0 PVARS DROP to 
  194.        generate the base list) 
  195.  
  196.     h) warmstart the '48 (power cycle it, or press [ON]-[C]) 
  197.  
  198. As mentioned, <-RPL-> is compiled to an absolute address. Its config code 
  199. takes care of the address the library is stored at. On an SX, if neccessary, 
  200. the base addresses of the ports are swapped and an additional warmstart 
  201. is initiated automatically while executing the first warmstart after 
  202. installation. If the config code recognizes that it is impossible to change 
  203. to the correct address (ie. the library is stored in port 0, not the 1st 
  204. object of port 1 or 2 on a SX, or not the 1st object of port 1 on a GX), the 
  205. autoattach to the home directory is supressed and no (c)-message and no beeps 
  206. are generated. If the library did not attach itself, make sure it becomes the 
  207. 1st object of the desired port and execute a warmstart again. 
  208.  
  209. If you have installed an HP41 emulator card, <-RPL-> does not install because 
  210. the emulator uses a similar sheme to install itself to the same address (it 
  211. is also an absolute library) -- just remove the card. 
  212.  
  213. The <-RPL-> and the <-LIB-> libraries are not self-modifing - you can write 
  214. protect the card containing the libraries. 
  215.  
  216.  
  217. 1.4 Abbreviations 
  218. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  219.  
  220. LID   - library id; a number in the range 0..2047, part of any library, It 
  221.     is used by the HP firmware to identify libraries while resolving 
  222.     commands, messages etc. 
  223. |     - used in stack diagrams for 'or' 
  224.  
  225. Abbreviations denoting objects: 
  226.  
  227. ob    object of any type 
  228. xlib    named or unnamed library command 
  229. :x:y    tagged object - tag x, ob y 
  230. prg    program (secondary) 
  231. bak    backup 
  232. dir    directory 
  233. alg    algebraic 
  234. lib    library 
  235. libdta    library data 
  236. meta(t)    meta object, obn .. ob1 %n, all ob's are of the same type t 
  237.  
  238. All other abbreviations are defined in RPLMAN.DOC (like %, # etc.). 
  239.  
  240.  
  241. 2. <-RPL-> Library 
  242. íííííííííííííííííí 
  243.  
  244.  
  245. 2.1 Overview 
  246. ÄÄÄÄÄÄÄÄÄÄÄÄ 
  247.  
  248. <-RPL-> contains 17 commands, including a sys-RPL compiler (->RPL), a sys-RPL 
  249. decompiler (RPL->), a Saturn assembler (->COD), a Saturn disassembler (COD->) 
  250. a RPL.TAB browser (EC) and a medium font sys-stack environment (4/5/7). 
  251.  
  252.  
  253. 2.2 The System-RPL Compiler/Decompiler 
  254. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  255.  
  256. The compiler is a simple token based one pass LR compiler and implements a 
  257. grammatical subset of RPLCOMP.EXE. It accepts string objects containing a 
  258. token sequence, seperated by whitespace (NL,CR,Space,TAB etc.), as input. 
  259.  
  260. The output of the decompiler can be used as input for the compiler or (with 
  261. minor modifications) as input for RPLCOMP.EXE. 
  262.  
  263. While ->RPL is compiling a string, it recognizes certain words and generates 
  264. appropriate code for them. All other words are assumed to be the labels of 
  265. objects in the runstream and are emitted simply as 5-nibble constants - the 
  266. reference table (see below) and the assembler symbol table are searched to 
  267. resolve the appropriate 5-nibble addresses. If an entry can't be found in one 
  268. of the tables and its 1st chararcter is a 'x', then ->RPL will try to resolve 
  269. the word without the leading 'x' as a built-in word (e.g. for 'xDROP' the 
  270. address #1FBD8 would be generated). 
  271.  
  272. If the currently processed token isn't resolvable by ->RPL as an object, 
  273. entry, or built-in word, it is passed to the user-RPL compiler, palparse. 
  274. If the result is an ID or prg, an error will be generated. If the token is 
  275. parsed to a %, it will be converted to a # (eg. "12345" ->RPL --> <3039h> 
  276. (negative values are mapped to 0 and fractional parts are ignored)); any 
  277. other valid object is simply added to the runstream (eg. [[1,2][3,4]] (F(.)) 
  278. inserts a 2*2 array of %). 
  279.  
  280. The following words are recognized by ->RPL or generated by RPL->: 
  281.  
  282. LAM <id>                                (1) 
  283.     DOLAM object whose name is specified by <id>. 
  284.  
  285. ID <id>                                 (1) 
  286.     DOIDNT object whose name is specified by <id>. 0-IDs aren't supported by 
  287.     ->RPL. 
  288.  
  289. TAG <id> <ob> 
  290.     DOTAG object whose tag is specified by <id> and whose object is given 
  291.     by <ob>. 
  292.  
  293. $ "string"                              (1) 
  294.     DOCSTR object with the contents contained between the quotes. 
  295.  
  296. CHR <char>                              (1) 
  297.     DOCHAR object with the specified character. 
  298.  
  299. # <hex>                    (3) 
  300. #<hex>                    (3) 
  301.     DOBINT object whose body is the number specified in hex. 
  302.  
  303. % <real> 
  304.     DOREAL object with the specified floating-point number. 
  305.  
  306. %% <extended real> 
  307.     DOEREL object with the specified floating-point number. The number is 
  308.     parsed with % resolution. 
  309.  
  310. C% <real> <real> 
  311.     DOCMP object with the specified floating-point numbers. 
  312.  
  313. C%% <extended real> <extended real> 
  314.     DOECMP object with the specified floating-point numbers. The numbers are 
  315.     parsed with % resolution. 
  316.  
  317. PTR <address in hex>            (2,5) 
  318.     Inserts the specified address as a runstream pointer-obj. 
  319.  
  320. ROMPTR <LID> <rom word> 
  321.     DOROMP obj whose body will contain the two 3-digit hex numbers. 
  322.  
  323. HXS <length in hex> <hstring> 
  324. GROB <length in hex> <hstring> 
  325. CODE <length in hex> <hstring>        (2) 
  326. ARRY <length in hex> <hstring>        (2) 
  327. LNKARRY <length in hex> <hstring>    (2) 
  328. LIBRARY <length in hex> <hstring>    (2) 
  329. BACKUP <length in hex> <hstring>    (2) 
  330. LIBDAT <length in hex> <hstring>    (2) 
  331. EXT1 <length in hex> <hstring>        (2,4) 
  332. EXT2 <length in hex> <hstring>        (2) 
  333. EXT3 <length in hex> <hstring>        (2) 
  334. EXT4 <length in hex> <hstring>        (2) 
  335.     Specified object whose body is made from the specified hex-string. 
  336.     Zero-length obj's aren't supported by ->RPL. 
  337.  
  338. ACPTR <data address> <access routine address>    (2,4) 
  339.     DOACPTR object, whose data and access routine addresses are built from 
  340.     the two specified hex numbers. 
  341.  
  342. NIBB <length in hex> <hstring>        (2) 
  343.     Adds the binary form of the specified hex string to the runstream, eg. 
  344.     NIBB 7 84E2000 creates a 0-ID. 
  345.  
  346. CODE <assembler source ..> ENDCODE 
  347.     CODE object, the assembler is called to assemble the body. 
  348.  
  349. ASSEMBLE <assembler source ..> RPL 
  350.     The assembler is called to assemble the inline code. 
  351.  
  352. INCLUDE <name> 
  353.     The accessable path is searched for a variable with the name <name>. Its 
  354.     contents must be a compilable string and may contain further INCLUDE 
  355.     statements. The resulting code is inserted at the position of the INCLUDE 
  356.     statement. 
  357.  
  358. INCLOB <name>                (2) 
  359.     The accessable path is searched for a variable with the name <name>. Its 
  360.     recalled contents are inserted at the position of the INCLOB statement. 
  361.  
  362.  
  363. The following words create runstream pointer obj's: 
  364.  
  365. UNIT    DOEXT  - Unit start 
  366. SYMBOL    02AB8  - Symbolic start 
  367. ::    DOCOL  - Program start 
  368. {    DOLIST - List start 
  369. }    SEMI   - List terminator 
  370. ;    SEMI   - Program, UNIT or SYMBOL terminator 
  371.  
  372.  
  373. Text surrounded by ' (' and ') ' is ignored by ->RPL. 
  374.  
  375.  
  376. Before you start compiling your own objects, play with the decompiler to 
  377. get some examples of the syntax definitions, eg. try { + } 1 GET RPL-> to 
  378. decompile 'x+'. 
  379.  
  380. ->RPL will automatically add SEMIs at the end of a compiled object to close 
  381. any open composite object, ie. compiling ":: 1" will create :: ONE ; 
  382.  
  383. Note (1) 
  384.     Character substitution is supported via '\xxx' in strings, IDs, LAMs and 
  385.     CHRs using the internal routine which does the tranlsation for TRANSIO, 
  386.     code 3 (see the '48 manual for a complete description). You must use 
  387.     '\034' to insert doublequotes (") into strings. 
  388.     RPL-> generates (") within strings, not \034. 
  389.  
  390. Note (2) 
  391.     These statements are not supported by RPLCOMP.EXE. 
  392.  
  393. Note (3) 
  394.     ->RPL accepts BINTS in one of the following form: 
  395.     # xxx - allways compiled to BINT objects 
  396.     #xxx  - searches the ROM for a BINT with the appropriate value, if 
  397.         found a pointer to it is generated instead of a BINT object 
  398.     xxx   - real numbers are COERCED and then handled like #xxx 
  399.  
  400. Note (4) 
  401.     ACPTR and EXT1 obj's do have the same prologue addresses but are defined 
  402.     differently, the former is a GX only obj, the latter an SX only obj. 
  403.     ->RPL won't allow you to compile a EXT1 obj on a GX and vice versa. RPL-> 
  404.     can only handle ACPTR ! 
  405.  
  406. Note (5) 
  407.     If you want to recompile a source generated by RPL->, you must manually 
  408.     replace all PTR 12345 statements by 
  409.  
  410.         ASSEMBLE 
  411.             CON(5)    #12345 
  412.         RPL 
  413.  
  414.  
  415. 2.3 The Saturn Assembler/Disassembler 
  416. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  417.  
  418. The assembler defines a subset of SASM.EXE written by Nathan Zelle. You can 
  419. use it 'stand-alone' or in conjunction with the RPL compiler ->RPL. It's a 
  420. 2-pass assembler. 
  421.  
  422. The input string should be plain ASCII (with blanks and/or TAB's) generated 
  423. on a PC or the '48 itself. 
  424.  
  425. It is 'free format' which means that no column counting is required, except 
  426. that labels MUST begin in the first coloumn of a line. 
  427.  
  428. If a line consists only of a comment, an '*' MUST be in column 1. Empty lines 
  429. are ignored. 
  430.  
  431. The general line structure is: "<label> [<mnemonic> [<parameter>] [<comment>]]" 
  432. or "* <comment>"; the fields are seperated by blanks or TABs. 
  433.  
  434. Most parameters can be symbolic (eg. " GOVLNG (=SAVPTR)+45*3" is valid). 
  435.  
  436. The assembler supports conditional assembling as well as defining equates via 
  437. "Label  EQU  expression". Please refer to SASM.DOC for more details. 
  438.  
  439. You can call global entry points if a reference table is installed. 
  440.  
  441. A predefined standard macro named LOOP is also included. If entered in the 
  442. mnemonic field it will be assembled to " GOVLNG  =Loop", an address which 
  443. simply does 
  444.  
  445. =Loop A=DAT0  A 
  446.       D0=D0+  5 
  447.       PC=(A) 
  448.  
  449. If the assembler source don't contain any code, the 2nd pass is skiped to 
  450. speed up RPL define like constructs - eg. a directory may hold along with 
  451. the source strings a variable HEADER: 
  452.  
  453. (HEADER) 
  454. ASSEMBLE 
  455. @a EQU =1GETLAM 
  456. !a EQU =1PUTLAM 
  457. @b EQU =2GETLAM 
  458. !b EQU =2GETLAM 
  459. nr EQU =TWO 
  460. RPL 
  461.  
  462. which may be included by a source like: 
  463.  
  464. (xyz - just a program) 
  465. INCLUDE HEADER 
  466. :: 
  467.   CKN 
  468.   DUP nr #<> case SETSIZEERR 
  469.  
  470.   ' NULLLAM nr NDUPN {}N BIND 
  471.  
  472.   @a @b 2DUP EQUAL ?SWAP 
  473.   !b !a 
  474.     (...etc...) 
  475.   ABND 
  476.  
  477.  
  478. 2.3.1 The Assembler Parameter Field Parser 
  479. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  480.  
  481. Parameter fields are parsed by an expression parser that is defined as 
  482. follows: 
  483.  
  484.     expr : expr op1 term | term 
  485.     term : term op2 fact | fact 
  486.     fact : '(' expr ')' | op3 fact | '(' '=' entry ')' | '(' symbol ')' | num 
  487.  
  488.     op1  : '+' | '-' | '!' | '|' | '^' 
  489.     op2  : '*' | '/' | ':' 
  490.     op3  : '-' | '"' 
  491.  
  492.     num  : real-number | '#' hxs-number 
  493.  
  494.     entry  : label of RPL.TAB 
  495.     symbol : label of the assembler symbol table 
  496.  
  497.     op  action 
  498.     ÄÄ  ÄÄÄÄÄÄ 
  499.     *   multiply 
  500.     /   divide 
  501.     :   modulo 
  502.     "   ones complement 
  503.     -   subtract / twos complement 
  504.     +   add 
  505.     !   bit AND 
  506.     |   bit OR 
  507.     ^   bit XOR 
  508.  
  509. A complete expr must not contain whitespace chars. If an expression consists 
  510. only of a '#' number, an entry or a symbol, the parenteses aren't neccessary 
  511. (eg. @n EQU =1GETLAM ). Real numbers are converted internally to HXS numbers, 
  512. the accuracy is 64 bit. Parsing real numbers and hex numbers is done by the 
  513. '48 internal real/hex parser. The expr/term/fact parser uses the solver 
  514. token type table. 
  515.  
  516. Expressions of EQU parameter fields must resolve to the requested number 
  517. during the 1st assembler pass; they are ignored in the 2nd pass. 
  518.  
  519.  
  520. 2.4 The Reference Table 
  521. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  522.  
  523. RPL->, ->RPL, COD->, ->COD, EC, E<->A and 4/5/7 are looking for a reference 
  524. table named RPL.TAB which is used to resolve names and addresses of ROM 
  525. entry points. It may be stored in a variable, as a backup object in any port 
  526. or as a library command. If RPL.TAB exists, its recalled contents will be 
  527. evaluated and if the result is a string starting with '\000\010' it will be 
  528. used as a reference table. It is recommended to use one of the two tables 
  529. shipped with RPL48; they are made using the latest entries lists released by 
  530. HP as database - double named entries are removed and a few user-RPL names 
  531. are added to avoid conflicts when de/compiling different '->', '>>', 'END' 
  532. (user-RPL) words. 
  533.  
  534. For generating your own tables, use GENTAB.C, also shipped with RPL48. 
  535.  
  536. The following example (HP terminology) outlines the structure of a reference 
  537. table: 
  538.  
  539. ASSEMBLE 
  540.     CON(5)  =DOCSTR        String prologue 
  541.     REL(5)  TabEnd          Length field 
  542.     NIBASC  '\00\n'        Reference table identifier 
  543. *                A hash table, for each char from ' ' - DEL 
  544. *                a 5-nib offset into the table 
  545.     CON(5)    0        ' ' entry, empty 
  546.     REL(5)    _!_        relativ offset to words starting with '!' 
  547.     CON(5)    0        '"' entry, empty 
  548. *       ...            '#' - 'C' 
  549.     REL(5)    _D_        'D' entry 
  550. *       ...            'E' - '}' 
  551.     CON(5)    0        '~' entry, empty 
  552.     CON(5)    TabEnd        DEL entry, always TabEnd 
  553.  
  554. _!_ 
  555.     CON(6)    #9623A0 
  556.     NIBASC    `!!append$` 
  557. *    ... 
  558. _D_ 
  559. *                úÄÄÄÄÄÄÄ Length of the label in bytes. 
  560. *                3        A label can't be > 15 chars in size. 
  561. *                3úââââÄÄ Address associated to the label, here 074E4 
  562. *                333333 
  563.     CON(6)  #6074E4        Address/length field of the following 
  564.     NIBASC  'DOBIND'    Label 
  565.  
  566. TabEnd 
  567. RPL 
  568.  
  569.  
  570. 2.5 Command Reference 
  571. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  572.  
  573. RPL->        ( ob            --> $                ) 
  574.  
  575.     Decompiles an object into a string. The string can be used as input for 
  576.     ->RPL without modifications (most times). 
  577.  
  578.  
  579. ->RPL        ( $            --> ob                ) 
  580.  
  581.     Compiles the input string to an object. 
  582.  
  583.  
  584. DCADR        ( hxs[adr]        --> $ hxs[adr]'            ) 
  585.  
  586.     Decompiles the object referenced by the address adr to a string in 
  587.     level 2 and increment the address by the object size. 
  588.  
  589.  
  590. COD->        ( code            --> $                ) 
  591.  
  592.     Disassembles a code object, generates HP styled mnemonics. The reference 
  593.     table is searched for addresses of GO and Dx=(5) mnemonics. The string 
  594.     can be used as input for ->COD without modifications (most times). 
  595.  
  596.  
  597. ->COD        ( $            --> code LibDat            ) 
  598.  
  599.     Assembles a code object. LibDat is the compressed form of a cross 
  600.     reference listing, use SYM-> (see below) for decompression. 
  601.  
  602.  
  603. ->OB        ( hxs[adr]        --> ob                ) 
  604.         ( #adr            --> ob                ) 
  605.         ( XLIB            --> ob                ) 
  606.         ( ob            --> ob'                ) 
  607.  
  608.     Input    Action 
  609.     ÄÄÄÄÄ       ÄÄÄÄÄÄ 
  610.     hxs        Build a pointer, pointing to the address given by the value 
  611.         of hxs[adr]. 
  612.     #        Same as for hxs, except if the value of # points to a valid 
  613.         ob in the hidden ROM; in this case the object is copied into 
  614.         TEMPOB. Eg. "# 72000" ->RPL ->OB returns the message table 
  615.         of the internal library 0. 
  616.         On a GX, passing a # is the same as passing a HXS. 
  617.     XLIB    Does a rompointer recall. 
  618.     ob        Unconditionally TOTEMPOB. 
  619.  
  620.  
  621. DAN        ( hxs[adr] %n        --> $1 .. $n hxs[adr]'        ) 
  622.  
  623.     Disassembles n instructions starting at address hxs[adr]. 
  624.  
  625.  
  626. DA1        ( hxs[adr]        --> $ hxs[adr]'            ) 
  627.  
  628.     Disassembles the instruction at address hxs[adr]. 
  629.  
  630.  
  631. DAXY        ( hxs[start] hxs[end]    --> $                ) 
  632.  
  633.     Disassembles until the actual adr. is > hxs[end], starting at address 
  634.     hxs[start]. 
  635.  
  636.  
  637. SYM->        ( LibDat        --> $                ) 
  638.  
  639.     Converts the cross reference table produced by ->COD into a string. 
  640.  
  641.  
  642. $->        ( $            --> ob                ) 
  643.  
  644.     Converts a hex-dump to an object. 
  645.  
  646.  
  647. ->$        ( ob            --> $                ) 
  648.  
  649.     Generates a hex-dump of an object. 
  650.  
  651.  
  652. EC        (            --> ?                ) 
  653.  
  654.     Entries Catalog - the reference table browser. Errors if no RPL.TAB 
  655.     can be found. 
  656.  
  657.     When starting EC the first time, it'll create the variable ECpar in 
  658.     the HOME directory. It contains a HXS that is used by EC as a lookup 
  659.     table into RPL.TAB; you may store the variable into a port (like 
  660.     RPL.TAB). Any time you install a new reference table it is neccessary 
  661.     to purge ECpar ! 
  662.  
  663.     The main display of EC shows eight entries, one per line. Each line shows 
  664.     the name and the addresses of an entry, a 'm' behind the address marks non 
  665.     RPL entries (ie. ML entries). These words are probably for use within 
  666.     assembly only. One line is inversed, showing the current position of 
  667.     the cursor bar which can be moved by the UP/DOWN arrows. 
  668.  
  669.     Active keys in the main display of EC: 
  670.  
  671.       Unshifted: 
  672.     UP    - move scroll bar up one word 
  673.     DOWN  - move scroll bar down one word 
  674.     ENTER - push highlighted word as $ onto the stack. If EC is launched 
  675.         from a command/edit line, ENTER coppies the word into the 
  676.         editline starting at the current cursor position 
  677.     NXT   - scan for next occurence of the SCAN word. 
  678.     ON    - exit EC or cancel sub-action 
  679.  
  680.       Rightshifted: 
  681.     ENTER - in case no editline exists, the current word is copied into a 
  682.         newly opened editline 
  683.     UP    - move to first entry 
  684.     ON    - turn off 
  685.  
  686.       Menu keys: 
  687.     PG|^  - page up 
  688.     PG|v  - page down 
  689.     SCAN  - prompts for a $ to search, ENTER starts searching. If EC is 
  690.         launched from a command/edit line, the prompt looks a bit 
  691.         suspicious, but its functionality is the same 
  692.     A-Z   - try it 
  693.     A->ST - push the address of the current word onto the stack. If EC 
  694.         is launched from a command/edit line, the A->ST key changes 
  695.         to the ABOUT key. 
  696.     HELP  - provides two pages of help on keys 
  697.  
  698.     For use of EC within a normal edit line, append the following list to 
  699.     your CST variable and launch EC with CST EC: 
  700.     { $ "EC" :: TakeOver ROMPTR 4D2 C (EC) ; } 
  701.  
  702.  
  703. E<->A        ( hxs[adr] | $name    --> $name | hxs[adr]        ) 
  704.  
  705.     Searches the reference table for a name or address of a given address or 
  706.     name. Errors if the label or address can't be resolved. 
  707.  
  708.  
  709. RPLtab        (            --> $                ) 
  710.  
  711.     Tries to recall the ref. table via RPL.TAB. If no table is found, a 
  712.     zero-length string is returned. 
  713.  
  714.  
  715. 4/5/7        (            -->                ) 
  716.  
  717.     Starts the medium font sys-stack display in five line mode. Pressing 
  718.     4/5/7 in five line mode switches to seven line mode, in seven line mode 
  719.     the sys-stack is canceled. 
  720.  
  721.     If you have flag 61 set, the commandline changes to sys-RPL mode, and 
  722.     the i-stack allows you to edit objects in sys-RPL syntax when pressing 
  723.     the EDIT menu key. 
  724.  
  725.     The following keys are redefined while the 5/7 stack is active: 
  726.       - pressing the up arrow without an active edit/commandline starts a 
  727.     5/7 level interactive sys-RPL stack 
  728.       - pressing the down arrow without an active edit/commandline starts 
  729.     editing the object of stack level one in sys-RPL syntax, if flag 
  730.     61 is set. 
  731.       - pressing ENTER to terminate a command line compiles it using the 
  732.     internal ->RPL, if flag 61 is set. 
  733.  
  734.     YOU MUST NOT MOVE THE <-RPL-> LIBRARY WHILE 4/5/7 IS ACTIVE !! 
  735.     (ie. DON'T MERGE THE PORT WHERE <-RPL-> IS STORED WITH AN ACTIVE 4/5/7 !!) 
  736.  
  737.     Clear flag 62 to quit 4/5/7 if you wan't to purge/move <-RPL->. 
  738.  
  739.  
  740. CC        (            --> ?                ) 
  741.  
  742.     Character set Catalog. CC displays a map of 128 characters in the small 
  743.     font along with some more information for the highlighted char. You can 
  744.     move through the map using the cursor keys. If you hold down one of the 
  745.     cursor keys, it will repeat until you release. The ON-key exits the 
  746.     program, RIGHT-ON turns the calc off and ENTER fetches the char number 
  747.     (tagged with the char) to the stack. 
  748.  
  749.     There are three menu keys available: 
  750.       SWAP - swaps between the upper/lower half of the char set 
  751.       BIN  - toggles the char code display from real/hex to binary and back 
  752.       EXIT - leaves CC 
  753.  
  754.     If you launch CC within an active editline (eg. via the CST menu), ENTER 
  755.     will copy the highlighted character into the editline to the current 
  756.     cursor position. For use of CC within a normal edit line, append the 
  757.     following list to your CST variable and launch CC with CST CC: 
  758.     { $ "CC" :: TakeOver ROMPTR 4D2 10 (CC) ; } 
  759.  
  760.  
  761. 2.7 Hooks 
  762. ÄÄÄÄÄÄÄÄÄ 
  763.  
  764. There are a few user hooks in <-RPL->, each an unnamed ROMPTR: 
  765.  
  766. ROMPTR 4D2 13    (            -->                ) 
  767.  
  768.     Switches to ADISP and displays a 5/7 level sys-RPL stack. 
  769.  
  770.  
  771. ROMPTR 4D2 14    (            -->                ) 
  772.  
  773.     Errors if <-RPL-> isn't ATTACHed to the HOME directory. 
  774.  
  775.  
  776. ROMPTR 4D2 15    ( ob            --> $                ) 
  777.  
  778.     Decompiles an object in quiet mode, eg. for editing. 
  779.  
  780.  
  781. ROMPTR 4D2 16    ( $            -->                ) 
  782.  
  783.     Compiles a string in quiet mode, eg. after editing. 
  784.  
  785.  
  786. Note: no stack checks are done by these routines ! 
  787.  
  788.  
  789. 2.7 Things to Notice 
  790. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  791.  
  792. ->RPL maintains a global assembler symbol table while compiling an object, 
  793. ie. it is possible to jump backward from a code object to a previous one: 
  794.  
  795. :: 
  796.   CODE 
  797. Lp LOOP 
  798.   ENDCODE 
  799.   CODE 
  800.    GOTO lp 
  801.   ENDCODE 
  802.  
  803. (Note: in the current version of <-RPL-> this seems not to work, I'm bug 
  804.  hunting... Detlef) 
  805.  
  806. ->RPL tries to resolve a token in the following order: 
  807.     1. check for atomic object (eg. %, # et c.) 
  808.     2. search reference table 
  809.     3. search symbol table 
  810.     4. check for #<hex-no> 
  811.     5. check for user-RPL word 
  812.     6. check for user-RPL object 
  813.  
  814. The search of the symbol table enables the programmer to use DEFINE like 
  815. constructs: 
  816.  
  817. :: 
  818.   ASSEMBLE 
  819. @val EQU =1GETLAM 
  820. !val EQU =1PUTLAM 
  821.   RPL 
  822.  
  823.   ONE 1LAMBIND 
  824.   @val #1+ !val 
  825.   1GETABND 
  826.  
  827.  
  828. 3. <-LIB-> 
  829. íííííííííí 
  830.  
  831.  
  832. 3.1 Overview 
  833. ÄÄÄÄÄÄÄÄÄÄÄÄ 
  834.  
  835. <-LIB-> contains 39 commands, including a library maker (D->LIB), a library 
  836. splitter (L->DIR), commands to handle any sort of composite objects and 
  837. commands to manage libraries. 
  838.  
  839. Libraries are very useful objects to extend the command set of a '48 in a 
  840. 'native' manner, but unfortunately library creation is not supported by the 
  841. '48 firmware. The HP tools package contains the program USRLIB.EXE, which 
  842. provides library creation on a PC; if you want to move your most often used 
  843. programs into a library (because of easier handling and to keep your VARs 
  844. area clean), you have to collect them into a subdirectory, add a few control 
  845. variables, transfer the directory in binary form to a PC, run USRLIB.EXE on 
  846. it, and transfer the created library back to your '48, where you can install 
  847. and test the library. 
  848.  
  849. <-LIB-> provides the command D->LIB that works on the currently active 
  850. directory, allowing you to create a library from this directory on the '48 
  851. itself - no transfers, no PC, and no USRLIB.EXE are required. 
  852.  
  853. The input directory stucture of D->LIB is very similar to the directory 
  854. structure required by USRLIB.EXE, thus existing USRLIB.EXE input can be 
  855. used for a library creation with minor changes (the difference is the 
  856. format of the $MESSAGE control variable, see below). 
  857.  
  858.  
  859. 3.2 Control Variables 
  860. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  861.  
  862. The library creation process is controlled by some variables with reserved 
  863. names and only the current directory is searched for their presence (note: 
  864. multiple occurences of these names are ignored, only the contents of the 
  865. first one found in the current directory is used for the library creation 
  866. process): 
  867.  
  868. $ROMID 
  869.     Must contain a real or binary number representing the LID that is to 
  870.     be given to the library. The LID must be in the range 0..2047. Negative 
  871.     real numbers are mapped to 0. 
  872.     This is the only control variable that MUST exist in the current 
  873.     directory ! 
  874.  
  875. $TITLE 
  876.     Should contain a character string to be used as the name of the library 
  877.     (note: any other object is converted to a string). The first few 
  878.     characters of the name are displayed in the LIBRARY menu label 
  879.     associated to the library, the first 22 characters are displayed by 
  880.     pressing REVIEW in the LIBRARY menu. If $TITLE is absent or contains an 
  881.     empty string, no title is generated and the resulting library doesn't 
  882.     have a menu label in the LIBRARY menu (note: you can switch to the 
  883.     library's command menu by executing %LID MENU, even if the library 
  884.     doesn't have a name or is not attached). 
  885.  
  886. $CONFIG 
  887.     Must contain a program to be executed at configuration time. 
  888.     The configuration code can generally NOT be written in user-RPL, but 
  889.     simple programs such as \<< 123 ATTACH \>> are Ok - more complicated 
  890.     programs should take care to leave the stack unchanged, and be sure 
  891.     NOT TO ERROR ! An error in a configuration program will cause a warmstart; 
  892.     the configuration code is called again during the startup process, 
  893.     producing a new error etc. If you are accidentally trapped by this, you 
  894.     must clear your memory to remove the faulty library ! 
  895.  
  896. $MESSAGE 
  897.     Must contain a list of strings to be combined into a message table (note: 
  898.     any other objects are converted to strings). The message numbers 
  899.     correspond to the list positions. In user-RPL you can generate errors 
  900.     with your own messages in the following manner: 
  901.         #32001h DOERR 
  902.              33333 
  903.              333àáÄÄ Message number     (here 1) 
  904.              àááÄÄÄÄ LID                (here #320h = 800) 
  905.     In sys-RPL you can use 
  906.         # 32001 ERROROUT 
  907.  
  908.     In this example an error is generated, using the first message from the 
  909.     message table of a library with the LID 800. 
  910.  
  911.     Note: The message list structure is NOT compatible to USRLIB.EXE. 
  912.  
  913. $VISIBLE 
  914.     Must contain a list of names of variables to be converted to user- 
  915.     accessible, named library commands. By default, all variables will be 
  916.     translated to named library commands. When the $VISIBLE list is present, 
  917.     only the names in this list are included in the library hash table. An 
  918.     empty list is Ok, meaning that no hash table is generated. 
  919.  
  920. $HIDDEN 
  921.     Must contain a list of names of variables that are to be converted to 
  922.     unnamed objects in the library. When the $HIDDEN list is present, those 
  923.     names listed are not entered in the library hash table. If both $VISIBLE 
  924.     and $HIDDEN are present, only $HIDDEN will be used. 
  925.  
  926.     Note: all visible commands appear as labeled softkeys in the menu 
  927.     associated to the library, all hidden commands are not, and there is no 
  928.     way to access them from user scope. 
  929.  
  930. $VARS 
  931.     Must contain a list of variables that should remain RAM-based - i.e. the 
  932.     objects of the variables listed in $VARS are not included in the library 
  933.     and no XLIB pointers are made to substitute their names. All other 
  934.     variables of the current directory are included in the library. 
  935.  
  936.     Note: You should add all subdirectory names of the current directory to 
  937.     the list. 
  938.  
  939. $ROMID must exist in the current directory, all other control variables are 
  940. optional - eg. you can generate libraries containing only a configuration 
  941. program or a message table. All control variables are internally handled by 
  942. D->LIB to be $VARS and can't be accessed from within the library commands. 
  943.  
  944.  
  945. 3.4 Command Reference 
  946. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  947.  
  948. D->LIB        (            --> lib                ) 
  949.  
  950.     Dir to lib; assembles a library from the objects of the current directory. 
  951.     The creation process is controlled by a few variables with reserved names 
  952.     (see '3.3 Control Variables'). 
  953.     If you set flag -13 before running D->LIB, it will switch off the screen 
  954.     while working (for saving time and batteries). 
  955.  
  956.  
  957. L->DIR        ( %LID            --> dir                ) 
  958.         ( xlib            --> ob                ) 
  959.  
  960.     Lib to dir; if the argument is a LID then L->DIR assembles a directory 
  961.     containing all commands of this library as variables. The neccessary 
  962.     control variables (see 3.3) are also generated. D->LIB may be used to 
  963.     recreate the library. 
  964.     If the argument is an XLIB, then L->DIR recalls its object from the 
  965.     associated library onto the stack. 
  966.     If you set flag -13 before running L->DIR on a library, it will switch 
  967.     off the screen while working. 
  968.  
  969.     Note: You cannot use L->DIR to split <-LIB->, this should prevent users 
  970.     from a memory lost. If you are familiar with the internals of your '48, 
  971.     use 'ROMPTR@' (or ->OB of <-RPL->) to extract single routines from 
  972.     <-LIB->, but beware of starting the routines in RAM, most of them will 
  973.     crash your calc when running alone ! 
  974.  
  975.  
  976. MCFG        (            -->                ) 
  977.  
  978.     Make config; stores a configuration program into a variable named 
  979.     '$CONFIG' into the current directory. This configuration program will 
  980.     attach the generated library to the home directory at warmstarts (ON-C 
  981.     etc.). 
  982.     '$ROMID' must exist in the current directory. 
  983.  
  984.  
  985. ML->D        (            --> prg                ) 
  986.  
  987.     Generates a program with the following interface: 
  988.  
  989.         ( {}            --> libdta            ) 
  990.  
  991.     The list can contain anything. The program checks for argument count and 
  992.     type and may error with: 
  993.     #201 - To Few Arguments  - nothing on the stack 
  994.     #202 - Bad Argument Type - not a list on the stack 
  995.  
  996.     '$ROMID' must exist in the current directory. 
  997.  
  998.  
  999. MD->L        (            --> prg                ) 
  1000.  
  1001.     Generates a program with the following interface: 
  1002.  
  1003.         ( libdta        --> {}                ) 
  1004.  
  1005.     The program checks for argument count, type and correct LID and may error 
  1006.     with: 
  1007.     #201 - To Few Arguments   - nothing on the stack 
  1008.     #202 - Bad Argument Type  - no library data on the stack 
  1009.     #203 - Bad Argument Value - the libdta wasn't created by this lib 
  1010.  
  1011.     '$ROMID' must exist in the current directory. 
  1012.  
  1013.   Note: Store the programs generated by ML->D and MD->L into variables in 
  1014.   your source directory and use them as an interface to generate/resolve 
  1015.   data associated to the resulting library. 
  1016.  
  1017.  
  1018. OB->        ( prg            --> ob1 .. obn %n        ) 
  1019.         ( xlib            --> %LID %objno            ) 
  1020.         ( arry            --> ob1 .. obn { %di .. %d1 }    ) 
  1021.         ( alg            --> ob1 .. obn %n        ) 
  1022.         ( dir            --> ob1 id .. obn id %n        ) 
  1023.         ( id            --> $                ) 
  1024.         ( libdta        --> {} %LID            ) 
  1025.         ( bak            --> ob id            ) 
  1026.         ( id            --> $                ) 
  1027.         ( ob            --> dispatch to OBJ->        ) 
  1028.  
  1029.     OB-> is an extension to the built-in OBJ->, supporting system level 
  1030.     objects. 
  1031.  
  1032.  
  1033. ->DIR        ( ob1 id1 .. obn idn %n    --> dir                ) 
  1034. ->PRG        ( ob1 .. obn %n        --> prg                ) 
  1035. ->XLIB        ( %LID %cmdno        --> xlib            ) 
  1036.         ( #LID #cmdno        --> xlib            ) 
  1037. ->ARR        ( ob1 .. obn %n        --> arry            ) 
  1038.         ( ob1 .. obn { %di .. %d1 } --> arry            ) 
  1039. ->ALG        ( ob1 .. obn %n        --> prg                ) 
  1040. ->LD        ( {} %LID        --> libdta            ) 
  1041. ->BAK        ( ob id            --> bak                ) 
  1042. ->ID        ( $            --> id                ) 
  1043.  
  1044.     Functions to reverse OB->. 
  1045.  
  1046.     About ->ARR: 
  1047.        Generates arrays of any type and any dimension (eg. a four dimensional 
  1048.        array of libraries :-). 
  1049.        %di * .. * %d1 must be = n, ob1 .. obn must be of the same type. 
  1050.        All possible parameter errors are trapped. 
  1051.  
  1052.  
  1053. ADRp        ( ob            --> ob #addr            ) 
  1054.  
  1055.     Get address of ob. 
  1056.  
  1057.     Note: The data stack is a stack of pointers to objects. ADRp simply 
  1058.     returns the value from the top element (about the 'p', see 'LIBp' below). 
  1059.  
  1060.  
  1061. $romid 
  1062. $visible 
  1063. $title 
  1064. $config 
  1065. $vars 
  1066. $hidden 
  1067. $message    (            --> '$XXX'            ) 
  1068.  
  1069.     These commands just put a control variable name onto the stack. 
  1070.  
  1071.  
  1072. LBCRC        ( lib            --> lib'            ) 
  1073.         ( bak            --> bak'            ) 
  1074.  
  1075.     Recalculates the CRC of a library or backup, useful if you have patched 
  1076.     it because modifying the body of a library or backup invalidates the CRC 
  1077.     included at the end of the body. 
  1078.  
  1079.  
  1080. RNLIB        ( lib $            --> lib'            ) 
  1081.  
  1082.     Renames a library, ie. changes title. 
  1083.  
  1084.  
  1085. CHLID        ( lib %            --> lib'            ) 
  1086.  
  1087.     Change LID; this program allows you to change the LID of a library if 
  1088.     it's not splittable. 
  1089.  
  1090.     Note: Most time a LID is also hardcoded in the config code - this can 
  1091.     generally not be changed by CHLID. You have to attach the library manually 
  1092.     after a warmstart. Also any library has its LID coded in a field above 
  1093.     any visible command (the error handling system identifies the command 
  1094.     that caused an error using this field (the sys-RPL commands 'CKn' copies 
  1095.     this values to the appropriate location)). These fields are not changed 
  1096.     by CHLID (yet). 
  1097.  
  1098.  
  1099. RHASH        ( %LID            --> hxs                ) 
  1100.  
  1101.     Recall hash table; get a pointer to the hash table of a library. 
  1102.  
  1103.  
  1104. RLINK        ( %LID            --> hxs                ) 
  1105.  
  1106.     Recall link table; get a pointer to the link table of a library. 
  1107.  
  1108.  
  1109. RCFG        ( %LID            --> ob                ) 
  1110.  
  1111.     Recall config code; get a pointer to the config code of a library. 
  1112.  
  1113.  
  1114. RMSG        ( %LID            --> arry            ) 
  1115.  
  1116.     Recall message table; get a pointer to the message table of a library. 
  1117.  
  1118. RTITLE        ( %LID            --> $                ) 
  1119.  
  1120.     Recall title; get the name of a library. 
  1121.  
  1122.  
  1123.     Note: RHASH, RLINK, RCFG, RMSG and RTITLE don't error if the library 
  1124.     associated to %LID didn't contain the requested item, they leave the 
  1125.     stack unchanged in that case. 
  1126.  
  1127.  
  1128. RPORT        ( %port            --> ob1 .. obn            ) 
  1129.  
  1130.     Recalls pointers to all objects of a given port (0/1/2 - 3-33 on a GX) 
  1131.     onto the stack, ignoring the R/W status of that port. 
  1132.  
  1133.  
  1134. RLIB        ( :%port:%LID        --> lib                ) 
  1135.         ( %LID            --> libn %portn ...        ) 
  1136.  
  1137.     Recall lib; the 1st case recalls a library from a given port, the 2nd 
  1138.     case searches ports 0,1,2 (followed by ports 3-33 on a GX) for libraries 
  1139.     with %LID, returning all found libraries and the port numbers where 
  1140.     they're stored. 
  1141.  
  1142.     Note: On a SX this command actually returns pointer to libraries (like 
  1143.     RPORT), if you recall a lib and try to purge it while it's on the stack, 
  1144.     you'll get a 'Object in use' error. Execute NEWOB or store it into a 
  1145.     variable first. 
  1146.  
  1147.  
  1148. PGLIB        ( :%port:%LID        -->                ) 
  1149.         ( %LID            -->                ) 
  1150.  
  1151.     Purge lib; the 1st case works like :%port:%LID PURGE, in the 2nd case the 
  1152.     ports are searched in order 0,1,2 (followed by ports 3-33 on a GX) for an 
  1153.     active library with %LID. The difference to PURGE: if the library is 
  1154.     attached to the home directory, it's detached before purging. On a SX: 
  1155.     Also if there is an inactive library with the same LID in any other port, 
  1156.     it becomes active and is attached to the HOME directory (if flag 5 is 
  1157.     set, its config code is executed - see STLIB below). 
  1158.  
  1159.  
  1160. STLIB        ( lib %port        -->                ) 
  1161.  
  1162.     Store lib into port; there're a few differences to STO: 
  1163.     - The library is installed full; a warmstart isn't neccessary 
  1164.       and thus not initiated at the next power cycle. All warmstart 
  1165.       volatile variables (stack, PICT) remains intact. 
  1166.     - The library last stored is visible to the '48 (in case of 
  1167.       having a library with the same LID installed in another port). 
  1168.     - If flag 5 is clear, the library is attached simply to the 
  1169.       home directory. 
  1170.     - If flag 5 is set, the config code of the library is executed 
  1171.       under warmstart conditions. Usefull for testing a config code. 
  1172.  
  1173.     Note: This command is currently disabled on a GX ! 
  1174.  
  1175.  
  1176. ACLIB        ( :%port:%LID        -->                ) 
  1177.  
  1178.     Activate library. You can install libraries with the same LID in different 
  1179.     ports, but only one will be visible to the '48 at the time. During 
  1180.     warmstarts the ports are searched in order 2,1,0 (most cases), ie. the 
  1181.     library stored in the port with the highest number will be active. 
  1182.     ACLIB allows you to switch to any other library with the same LID at 
  1183.     runtime, the effect is immidiate. ACLIB 1st detaches the LID from HOME, 
  1184.     sets the new priority and than a) attaches the LID to HOME again if flag 
  1185.     5 is clear, or b) runs the library config code if flag 5 is set (see STLIB 
  1186.     above). 
  1187.  
  1188.     Note: This command is currently disabled on a GX ! 
  1189.  
  1190.  
  1191. LIBp        ( %LID            --> $                ) 
  1192.  
  1193.     Returns a detailed layout of a library. The map starts with the title (if 
  1194.     exist), followed by the 1st and last address of the lib and the LID. The 
  1195.     remainder lists the contents of the lib, one line of information for each 
  1196.     XLIB entry. Structure of a line: 
  1197.  
  1198.     1st last  xn name  typ 
  1199.         333 3333  33 3333  àááÄ Type of the object 
  1200.         333 3333  33 àáááÄÄÄÄÄÄ Name of the object (if it's a visible cmd) 
  1201.         333 3333  àáÄÄÄÄÄÄÄÄÄÄÄ XLIB number of the object 
  1202.         333 àáááÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Last relative address of the object 
  1203.         àááÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Offset to startaddr. of the object 
  1204.  
  1205.     The list is sorted by offset. Try 1221 LIBp or 2 LIBp. 
  1206.  
  1207.     Note: If you find unexpected 'holes' between two XLIBs (> 10 nibbs) or 
  1208.     XLIBs embedded in other XLIBS, the library wasn't generated using 
  1209.     USRLIB.EXE or D->LIB; do not use D->LIB for recreating it because the 
  1210.     'holes' can hold essential data.. 
  1211.  
  1212.     Note: This command is currently disabled on a GX ! 
  1213.  
  1214.  
  1215. INSTp        (            --> { %LIDn .. %LID1 }        ) 
  1216.  
  1217.     Returns a list of all libraries attached to the current directory, { } if 
  1218.     none. 
  1219.  
  1220.     Note: You can PURGE libraries even if they are attached to a subdirectory. 
  1221.     INSTp can be used to find such zombie references. 
  1222.  
  1223.  
  1224. LIBSp        (            --> { %LID1 .. %LIDn }        ) 
  1225.  
  1226.     Returns a list of all libraries currently installed on your '48. 
  1227.  
  1228.  
  1229.   Note: We didn't use the '?' postfix because normally it marks a routine 
  1230.   for returning a flag in RPL. The JARGON file, v2.9.9, 01 APR 1992 states: 
  1231.  
  1232.     3. The `-P' convention: Turning a word into a question by 
  1233.     appending the syllable `P'; from the LISP convention of appending 
  1234.     the letter `P' to denote a predicate (a boolean-valued function). 
  1235.     The question should expect a yes/no answer, though it needn't. 
  1236.  
  1237.     At dinnertime: 
  1238.        Q: "Foodp?" 
  1239.        A: "Yeah, I'm pretty hungry." or "T!" 
  1240.  
  1241.     At any time: 
  1242.        Q: "State-of-the-world-P?" 
  1243.        A: (Straight) "I'm about to go home." 
  1244.        A: (Humorous) "Yes, the world has a state." 
  1245.  
  1246.   so we used 'p' for marking routines returning information ;-) 
  1247.  
  1248.  
  1249. fEVAL        ( ob            --> ?                ) 
  1250.  
  1251.     Works like EVAL, but switches the display off first. Speeds up evaluation 
  1252.     by ~11%. In case of an error or the ob has finished execution, the 
  1253.     display is switched on again. Not very useful, if ob prompts for input.. 
  1254.  
  1255.  
  1256. 3.5 Things to Notice 
  1257. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1258.  
  1259. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  1260. 3 HP 48 Resource Allocation Guideline: Library ID's 3 
  1261. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1262. 3 0000 - 0256  Take-over libraries; do not use!     3 
  1263. 3 0257 - 0512  HP ROM-based libraries; do not use!  3 
  1264. 3 0513 - 0768  HP RAM-based libraries; do not use!  3 
  1265. 3 0769 - 1791  3rd Party (assigned by HP)           3 
  1266. 3 1792 - 2047  Command-line; do not use!            3 
  1267. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  1268.  
  1269. [This sure doesn't seem to leave many for us hackers to use, eh?  -jkh-] 
  1270.  
  1271. *Don't use the following LIDs*, they're handled special by a '48SX (and 
  1272. probably also by a GX): 
  1273.  
  1274. LID        What's special ? 
  1275. ÄÄÄ             ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1276. 240-255        ROMPTR@ assumes that the associated library command is in the 
  1277.         hidden ROM. 
  1278. 0-256,1792    The central routine to compile IDs (PTR 7BFD on a SX, PTR 
  1279.         7C18 on a GX) returns pointer instead of XLIBs. 
  1280.  
  1281. The library stucture is 'flat', so don't try to include subdirectories in a 
  1282. library, it can end up in a memory lost. 
  1283.  
  1284. Not all program objects that execute correctly from global variables are 
  1285. directly convertable into libraries. Here are some pitfalls: 
  1286.  
  1287.     - Since a library cannot be modified, no library command may be the 
  1288.       target of a STO or PUT operation. 
  1289.     - XLIB names are not usable in all contexts in which global names are 
  1290.       valid arguments. This can cause constructs that reference a named 
  1291.       object to fail. For example, 
  1292.     'A' 5 GETI 
  1293.       where A is a list will not work when A is converted to an XLIB name. 
  1294.       Instead use 
  1295.         A 5 GETI 
  1296.     - XLIB names are not valid as formal variables in algebraics, or as the 
  1297.       independent variable for plotting or solving. 
  1298.     - \->STR applied to a global name that is converted to a 'hidden' library 
  1299.       command (see $HIDDEN) returns a null string. 
  1300.  
  1301. If any visible command starts with the seqence '\<< \->' or '\->' it's marked 
  1302. in the library as a valid command for algebraics. If you press its associated 
  1303. softkey in ALG entry mode, you'll get 'name()'. 
  1304.  
  1305. Multiple occurences of variable names results in an incorrect library because 
  1306. only the contents of the first one is picked up. 
  1307.  
  1308. D->LIB needs ~(1.2 * size_of_source_directory) bytes to be free to generate a 
  1309. library. 
  1310.  
  1311. The time D->LIB needs for doing a job depends mainly on the total number of 
  1312. commands included in the resulting library. Eg. Raymond runs D->LIB on a 
  1313. ~60kb directory containing ~300 variables; D->LIB needs ~15min on a rev A 
  1314. '48 to make the library (not in FAST-mode). Of course, this is quite faster 
  1315. than using USRLIB.EXE !!! 
  1316.  
  1317. Reassembling a split library may be dangerous if the original library was 
  1318. not generated using USRLIB.EXE or D->LIB. There is no guarantee that the 
  1319. result will work properly - even if no code changes are done. 
  1320.  
  1321. USRLIB.EXE generates a link table entry for the configuration program; if you 
  1322. split such a library with L->DIR, you'll get the configuration code twice, 
  1323. the first one stored in $CONFIG, the second one stored in a variable of the 
  1324. generated directory. Purge the variable before using D->LIB. You also can 
  1325. use LIBp to see the second reference to the config code. 
  1326.  
  1327.  
  1328. Appendix A - Quick Reference Guides 
  1329. ííííííííííííííííííííííííííííííííííí 
  1330.  
  1331.  
  1332. A.1 <-RPL-> 
  1333. ÄÄÄÄÄÄÄÄÄÄÄ 
  1334.  
  1335.  
  1336. A.1.1 Commands 
  1337. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1338.  
  1339. Page 1234.1 
  1340.  
  1341.     RPL->    ( ob        --> $        )    decompile object 
  1342.     ->RPL    ( $        --> ob        )    compile object 
  1343.     DCADR    ( hxs        --> $ hxs'    )    decompile one word 
  1344.     COD->    ( code        --> $        )    disassemble CODE 
  1345.     ->COD    ( $        --> code libdat    )    assemble CODE 
  1346.     ->OB    ( ob        --> ob'        )    convert object 
  1347.  
  1348. Page 1234.2 
  1349.  
  1350.     DAN        ( hxs %n    --> $1 .. $n hxs' )    disassemble n times 
  1351.     DA1        ( hxs        --> $ hxs'    )    disassemble one mnemo 
  1352.     DAXY    ( hxs hxs    --> $        )    disassemble block 
  1353.     SYM->    ( libdat    --> $        )    convert symbol table 
  1354.     $->        ( $        --> ob        )    hex-dump to object 
  1355.     ->$        ( ob        --> $        )    object to hex-dump 
  1356.  
  1357. Page 1234.3 
  1358.  
  1359.     EC        (        --> ?        )    entries catalog 
  1360.     E<->A    ( hxs | $name    --> $name | hxs    )    get name/address 
  1361.     RPLtab    (        --> $        )    recall ref. table 
  1362.     4/5/7    (        -->        )    sys-stack display 
  1363.     CC        (        --> ?        )    character set catalog 
  1364.  
  1365.  
  1366. A.1.2 Flag Usage 
  1367. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1368.  
  1369. General: 
  1370.  
  1371.     Flag    Meaning 
  1372.     ÄÄÄÄ        ÄÄÄÄÄÄÄ 
  1373.      -4        If set, RPL->/DCADR are using the disassembler to decompile 
  1374.         code objects. 
  1375.     -13        Quiet mode if set. The status report of RPL->, ->RPL, COD-> 
  1376.         and ->COD is suppressed. 
  1377.      64        Reserved. 
  1378.      63        Toggles sys-stack between 5/7 lines mode. 
  1379.      62        Set by 4/5/7 to signal an active medium font display. Can 
  1380.         be cleared to quit the sys-stack. 
  1381.      61        Toggles the behaivior of the down arrow key during sys-stack 
  1382.         display, the EDIT menu key during the sys-i-stack and the 
  1383.         ENTER key when finishing a command line. If set, you can edit 
  1384.         objects in sys-RPL syntax. A menu toggle for this flag can be 
  1385.         found on the 3rd page of the i-stack menu (labeled S-ED). 
  1386.  
  1387. DAN and DA1 are using the following flags: 
  1388.  
  1389.     Flag (set)    Meaning 
  1390.     ÄÄÄÄÄÄÄÄÄÄ  ÄÄÄÄÄÄÄ 
  1391.       1     next instr is a GO/RET YES/NO 
  1392.       2         last instr was RET... 
  1393.       3     last instr was GO C/NC/TO 
  1394.       4     last instr was relative GOSUB 
  1395.       5     last instr was absolute GO 
  1396.       6     last instr was PC manipulation 
  1397.       7     used internaly 
  1398.       8     last instr was absolute GO or Dx=(5) 
  1399.  
  1400.  
  1401. A.1.3 Error Messages 
  1402. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1403.  
  1404. General Errormessages: 
  1405.  
  1406.     "Undefined XLIB Name" 
  1407.     Requests to execute a command when the <-RPL-> library is not attached 
  1408.     to the HOME directory will cause this error. See section 1.3. 
  1409.  
  1410.     "Need Binary Number" 
  1411.     The object passed to DCADR or DA1 isn't a binary number. 
  1412.  
  1413.     "Need String" 
  1414.     The object passed to ->RPL, ->COD or $-> isn't a string. 
  1415.  
  1416.     "Data Modifies Stack" 
  1417.     The object stored in RPL.TAB or ECpar doesn't add one item to the 
  1418.     stack. 
  1419.  
  1420.     "Where's your Program ?" 
  1421.     The string passed to ->RPL results to nothing. 
  1422.  
  1423.     "Primitive Code Object" 
  1424.     The object passed to RPL-> or the address passed to DCADR points to 
  1425.     a PCO. 
  1426.  
  1427.     "Found ACPTR on a SX" 
  1428.         RPL-> can't decompile ACPTR (ie. EXT1 objects) if <-RPL-> is installed 
  1429.         on a '48SX. 
  1430.  
  1431. ->COD Errormessages: 
  1432.  
  1433.     ->COD generates error messages of the following form: 
  1434.     "->COD Error: x:yy 
  1435.      Message" 
  1436.     where 'x' is the INCLUDE nesting depth and 'yy' is the character offset of 
  1437.     the first character following the token that caused the error. 'Message' 
  1438.     may be one of the following: 
  1439.  
  1440.     "ENDIF Expected"        an IF isn't matched by an ENDIF 
  1441.     "ENDIF w/o IF"        missplaced ENDIF 
  1442.     "ELSE w/o IF"        missplaced ELSE 
  1443.     "Invalid Parameter"        invalid parameter field 
  1444.     "Inv. Expr: expr"        invalid parameter field expression <expr> 
  1445.     "Invalid Mnemonic"        invalid menemonic 
  1446.     "Duplicate Label"        double defined label 
  1447.     "GOYES/RTNYES Expected"    comparisation without a following 
  1448.                 conditional jump 
  1449.     "GOYES out of range"    jump destination is more than -128/+127 
  1450.                 nibbles away 
  1451.     "Parameter Expected"    parameter of a mnemonic which expects 
  1452.                 one is missing 
  1453.     "Unknown Symbol: symb"    unknown symbol <symb> in an expression 
  1454.     "Inv. $: str"        invalid string <str> constant 
  1455.     "No IF Nesting Yet"        nesting of conditional IF .. ELSE .. ENDIF 
  1456.                 structures is not allowed (yet) 
  1457.     "Can't INCLUDE: nam" 
  1458.     There's no variable with the name <nam> 
  1459.  
  1460. ->RPL Errormessages: 
  1461.  
  1462.     ->RPL generates error messages of the following form: 
  1463.     "->RPL Error: x:yy 
  1464.      Message" 
  1465.     where 'x' is the INCLUDE nesting depth and 'yy' is the character offset of 
  1466.     the first character following the token that caused the error. Note that 
  1467.     if the error is generated by the asssembler (called by ->RPL to assemble 
  1468.     inline code), 'yy' is the error position relative to the first char after 
  1469.     the CODE or ASSEMBLE token. 'Message' may be one of the following 
  1470.     (additional to the ones listed for ->COD): 
  1471.  
  1472.     ") Expected" 
  1473.     Missing a ) to terminate a comment 
  1474.  
  1475.     "" Expected" 
  1476.     Missing a " to terminate a string 
  1477.  
  1478.     "ENDCODE Expected" 
  1479.     Missing the token ENDCODE to terminate a CODE statement 
  1480.  
  1481.     "RPL Expected" 
  1482.     Missing the token RPL to terminate a ASSEMBLE statement 
  1483.  
  1484.     "Misplaced ; or }" 
  1485.     Found a ; or } without a opening ::, {, UNIT or SYMBOL 
  1486.  
  1487.     "Suspect %" 
  1488.     "Suspect %%" 
  1489.     Parsing of a number results in an object of incorrect type 
  1490.  
  1491.     "Body Len <> Datalen" 
  1492.     The length field of a HXS-like styled statement is not equal to 
  1493.     the data length 
  1494.  
  1495.     "ACPTR is a G object" 
  1496.     ACPTR can only be compiled, if <-RPL-> is installed on a GX 
  1497.  
  1498.     "EXT1 is a S object" 
  1499.     EXT1 can only be compiled, if <-RPL-> is installed on a SX 
  1500.  
  1501.     "More Tokens Expected" 
  1502.     The statement at the end of the input string is incomplete 
  1503.  
  1504.     In the following messages 'ttt' represents the token that causes the 
  1505.     error: 
  1506.  
  1507.     "ROMP LibID >FFF: ttt" 
  1508.     "ROMP ROMWD >FFF: ttt" 
  1509.     The library ID part or the ROM word number part of a ROMPTR statement 
  1510.     is > FFF 
  1511.  
  1512.     "Suspect \ Seq: ttt" 
  1513.     The escape sequence ttt in the string, ID or LAM is incomplete or 
  1514.     invalid 
  1515.  
  1516.     "Can't INCLUDE: ttt" 
  1517.     "Can't INCLOB: ttt" 
  1518.     There's no variable with the name ttt 
  1519.  
  1520.     "Cont. no $: nam" 
  1521.     The INCLUDEd variable <nam> doesn't contain a string 
  1522.  
  1523.     "Inv. xxx: ttt" 
  1524.     where 'xxx' is one of the following: 
  1525.  
  1526.     "Tok"    - ttt is unresolvable 
  1527.     "#"    - ttt is out of range or contains chars other than hex digits 
  1528.     "$"    - ttt doesn't start with a " 
  1529.     "%","%%"- ttt represents an invalid number 
  1530.     "PTR"    - ttt is out of range or contains chars other than hex digits 
  1531.     "CHR"    - ttt contains more than one char 
  1532.  
  1533.     "Body Dat" - the data field of a HXS-like styled statement contains 
  1534.              chars other than hex digits 
  1535.     "Body len" - the length field of a HXS-like styled statement contains 
  1536.              chars other than hex digits 
  1537.     "RomWd"    - the ROM word number field of a ROMPTR is longer than 5 
  1538.              chars or contains chars other than hex digits 
  1539.     "LibID"    - the library ID field of a ROMPTR is longer than 5 chars 
  1540.              or contains chars other than hex digits 
  1541.     "APaa"     - the access address field of an ACPTR is longer than 5 
  1542.              chars or contains chars other than hex digits 
  1543.     "APda"     - the data address field of an ACPTR is longer than 5 
  1544.              chars or contains chars other than hex digits 
  1545.  
  1546.  
  1547. A.2 <-LIB-> 
  1548. ííííííííííí 
  1549.  
  1550.  
  1551. A.2.1 Commands 
  1552. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1553.  
  1554. Page 1221.1 
  1555.  
  1556.     D->LIB    (        --> lib        )    build library 
  1557.     L->DIR    ( %        --> dir        )    split library 
  1558.     MCFG    (        -->        )    make config program 
  1559.     ML->D    (        --> prg        )    make libdat-> handler 
  1560.     MD->L    (        --> prg        )    make ->libdat handler 
  1561.     OB->    ( ob        --> ?        )    split object 
  1562.  
  1563. Page 1221.2 
  1564.  
  1565.     ->DIR    ( meta(ob,id)    --> dir        )    make directory 
  1566.     ->PRG    ( meta(ob)    --> prg        )    make program 
  1567.     ->XLIB    ( % % | # #    --> xlib    )    make XLIB 
  1568.     ->ARR    ( meta(ob)    --> arry    )    make array 
  1569.     ->ALG    ( meta(ob)    --> alg        )    make algebraics 
  1570.     ->LD    ( {} %        --> libdta    )    make library data 
  1571.  
  1572. Page 1221.3 
  1573.  
  1574.     ->BAK    ( ob $        --> bak        )    make backup 
  1575.     ->ID    ( $        --> id        )    make identifier 
  1576.     ADRp    ( ob        --> ob #    )    get address of object 
  1577.     $romid    (        --> id        )    get id '$ROMID' 
  1578.     $visible    (        --> id        )    get id '$VISIBLE' 
  1579.     $title    (        --> id        )    get id '$TITLE' 
  1580.  
  1581. Page 1221.4 
  1582.  
  1583.     $config    (        --> id        )    get id '$CONFIG' 
  1584.     $vars    (        --> id        )    get id '$VARS' 
  1585.     $hidden    (        --> id        )    get id '$HIDDEN' 
  1586.     $message    (        --> id        )    get id '$MESSAGE' 
  1587.     LBCRC    ( lib | bak    --> lib' | bak'    )    recalculate CRC 
  1588.     RNLIB    ( lib $        --> lib'    )    rename library 
  1589.  
  1590. Page 1221.5 
  1591.  
  1592.     CHLID    ( lib %        --> lib'    )    change LID 
  1593.     RHASH    ( %        --> C#        )    get hash table 
  1594.     RLINK    ( %        --> C#        )    get link table 
  1595.     RCFG    ( %        --> prg        )    get config code 
  1596.     RMSG    ( %        --> arry    )    get message table 
  1597.     RTITLE    ( %        --> $        )    get title 
  1598.  
  1599. Page 1221.6 
  1600.  
  1601.     RPORT    ( %        --> ob ...    )    recall port 
  1602.     RLIB    ( %        --> lib % ...    )    recall library(s) 
  1603.     PGLIB    ( % | :%:%    -->        )    purge library 
  1604.     STLIB    ( lib %        -->        )    store library 
  1605.     ACLIB    ( :%:%        -->        )    activate library 
  1606.     LIBp    ( %        --> $        )    get library layout 
  1607.  
  1608. Page 1221.7 
  1609.  
  1610.     INSTp    (        --> {}        )    get installed LIDs 
  1611.     LIBSp    (        --> {}        )    get all LIDs on 48 
  1612.     fEVAL    ( ob        --> ?        )    fast EVAL 
  1613.  
  1614.  
  1615. A.2.2 Flag Usage 
  1616. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1617.  
  1618. 5    Set:    STLIB executes config code of passed library after 
  1619.         installation. 
  1620.         ACLIB executes config code of activated library. 
  1621.         <-LIB->s config code displays a (c) notice. 
  1622.     Clear:    STLIB and ACLIB are simply attaching the handled library 
  1623.         to the HOME directory. 
  1624.         <-LIB->s config code doesn't display (c) notice. 
  1625.  
  1626. 6    Set:    L->DIR places the $control variables at the end of the 
  1627.         generated directory. 
  1628.     Clear:    L->DIR places the $control variables at the beginning of 
  1629.         the generated directory. 
  1630.  
  1631. 7    Set:    L->DIR generates a $HIDDEN but no $VISIBLE variable. 
  1632.     Clear:    L->DIR generates a $VISIBLE but no $HIDDEN variable. 
  1633.  
  1634. -13    Set:    D->LIB/L->DIR switch the display off while processing 
  1635.         a directory/library (fast mode). 
  1636.     Clear:    D->LIB/L->DIR are leaving the display on while working. 
  1637.  
  1638.  
  1639. A.2.3 Error Messages 
  1640. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1641.  
  1642. "Missing $ROMID" 
  1643.     $ROMID is not defined in the current directory 
  1644.  
  1645. "$ROMID Not Real/Binary" 
  1646.     $ROMID doesn't contain a % or HXS object 
  1647.  
  1648. "$ROMID Out of Range" 
  1649.     a) the value of $ROMID is > 2047 
  1650.     b) a % > 2047 was passed to CHLID 
  1651.  
  1652. "$CONFIG Not a Program" 
  1653.     Because the stack must not change during warmstarts, $CONFIG must contain 
  1654.     a program 
  1655.  
  1656.     Note: Use 1 ->PRG to embedd CODE, IDs or XLIBs into a program. 
  1657.  
  1658. "$HIDDEN Not a List" 
  1659. "$VISIBLE Not a List" 
  1660. "$VARS Not a List" 
  1661. "$MESSAGE Not a List" 
  1662.     $XXX must contain a list 
  1663.  
  1664. "Found ID Name>16 Chars" 
  1665.     D->LIB have found a visible command name which is > 16 chars in size 
  1666.  
  1667. "Found 0-ID" 
  1668.     D->LIB have found a visible command name with the size 0 
  1669.  
  1670. "Won't work on a G" 
  1671.     The initiated operation can't be executed on a '48G(X). 
  1672.  
  1673.  
  1674. Appendix B - A ->COD Example 
  1675. íííííííííííííííííííííííííííí 
  1676.  
  1677.  
  1678. Key in the following text (including the string delimiters) on your '48 (you 
  1679. may leave out the comments): 
  1680.  
  1681. "       GOSBVL  =SAVPTR         ** Save RPL pointers in save locations 
  1682. **                   P is 0 , HEX mode enabled 
  1683.     LAHEX    123AFE        ** Load HEX nibbles into A Register 
  1684. **                   starting at P 
  1685.     P=    5        ** 
  1686.     GOVLNG    =PUSHhxsLoop    ** Push A[WP] onto Data stack 
  1687. **                   and pass control to RPL 
  1688.  
  1689. Store it in the variable SRC1. Recall the text to the stack, then press 
  1690. [->COD]. The display will show 'ASSEMBLER PASS 1' on the bottom line. In the 
  1691. upper part of the display 'Line  nnn' will appear, where <nnn> represents 
  1692. the actual code line to be assembled (empty lines or comment lines are not 
  1693. counted). 
  1694.  
  1695. A second later the display will show 'ASSEMBLER PASS 2' on the bottom line 
  1696. and 'Processing nnn Lines' in the message area. Another second later the 
  1697. source will have been assembled and the the string will be replaced by a 
  1698. 'Code' object and a 'Library Data' object. The stack should look as follows: 
  1699.  
  1700. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  1701. 3                     3 
  1702. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1703. 34:                   3 
  1704. 33:                   3 
  1705. 32:               Code3 
  1706. 31:       Library Data3 
  1707. 3## ### ### ### ### ##3 
  1708. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  1709.  
  1710.  
  1711. The Library Data object contains all used local symbols (eg. labels). For the 
  1712. above example, it is an empty string, as there are no local symbols. The Code 
  1713. object represents the assembled source text. DROP the Library Data object and 
  1714. store the Code object into 'XQ1', then press the menu key [XQ1] . The stack 
  1715. now looks like: 
  1716.  
  1717. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  1718. 3                     3 
  1719. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1720. 34:                   3 
  1721. 33:                   3 
  1722. 32:                   3 
  1723. 31:          # 123AFEh3 
  1724. 3## ### ### ### ### ##3 
  1725. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  1726.  
  1727.  
  1728. Now lets change example 1 to make use of the symbolic facilities of SASM48. 
  1729. First recall [SRC1] and edit the string: 
  1730.  
  1731. hexdig    EQU    #123AFE 
  1732. pHXS    EQU    5 
  1733.     GOSBVL    =SAVPTR     ** Save RPL pointers in save locations 
  1734. **                   P is 0 , HEX mode enabled 
  1735.     LA(6)    hexdig        ** Load 6 HEX nibbles (represented by hexdig) 
  1736. **                   into A Register , starting at P 
  1737.     P=    pHXS        ** Set P to the value specified by pHXS 
  1738.     GOVLNG    =PUSHhxsLoop    ** Push A[WP] onto Data stack 
  1739. **                   and pass control to RPL 
  1740.  
  1741. Store the string in SRC2, recall it back to the stack, then press [->COD]. 
  1742. The result looks like the result of example 1 except that the Library Data 
  1743. now contains the values of the defined labels. When the stack shows: 
  1744.  
  1745. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  1746. 3                     3 
  1747. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1748. 34:                   3 
  1749. 33:                   3 
  1750. 32:               Code3 
  1751. 31:       Library Data3 
  1752. 3## ### ### ### ### ##3 
  1753. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  1754.  
  1755. press [SYM->] (located on the second menu page). The display changes to: 
  1756.  
  1757. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  1758. 3                     3 
  1759. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1760. 34:                   3 
  1761. 33:                   3 
  1762. 32:               Code3 
  1763. 31: "hexdig  EQU   #..3 
  1764. 3## ### ### ### ### ##3 
  1765. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  1766.  
  1767.  
  1768. Press the down-arrow key: 
  1769.  
  1770. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  1771. 3                  prg3 
  1772. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1773. 3                     3 
  1774. 3                     3 
  1775. 3"hexdig  EQU   #123..3 
  1776. 3pHXS    EQU   #5     3 
  1777. 3## ### ### ### ### ##3 
  1778. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  1779.  
  1780. This is the symbol table for SRC2. Press ATTN to return to the stack. DROP 
  1781. the string in level 1 and store the Code object into 'XQ2'. Press [XQ2]. You 
  1782. will get the same result as in example 1 because it's the same machine 
  1783. language program. 
  1784.  
  1785. You could even use [COD->] to disassemble the Code object in level 1. 
  1786.  
  1787.  
  1788. Appendix C - Ordering Information 
  1789. ííííííííííííííííííííííííííííííííí 
  1790.  
  1791.  
  1792. The sources of the <-RPL-> and the <-LIB-> libraries consists of more than 
  1793. 18000 lines of RPL/assembler code (that's more than 300kb of text !) and we 
  1794. have spent our free time for more than two years in writing RPL48, so we 
  1795. decided to release this version as GiftWare - ie. you can use RPL48 as long 
  1796. as you like but only for developing non-comercial software and only as a 
  1797. private person. 
  1798.  
  1799. If you think RPL48 is useful and that the authors deserve to be rewarded for 
  1800. the time they have invested in developing this toolkit, feel free to send 
  1801. one of us (or both ;-) any sort of gift (even only a postcard will be 
  1802. welcome). 
  1803.  
  1804. If your gift covers the expense sending you a disk via SnailMail (costs 
  1805. are: the disk, an envelope, the stamp and our time -> ~$25 or something 
  1806. equivalent), we will send you the latest *whole* version of RPL48 on a 
  1807. MesS-DOS formatted disk (including the <-RPL-> library branded with your 
  1808. name in the startup message). Don't forget to include your name, address 
  1809. and the disk size you prefer. 
  1810.  
  1811. Developping commercial software using RPL48 requires registration via the 
  1812. GiftWare concept; companies must send us at least a $50-worth gift for 
  1813. registration. 
  1814.  
  1815. Planned for the future are: 
  1816.     - better ARRY support in <-RPL-> 
  1817.     - maybe a DIR support in <-RPL-> 
  1818.     - a built-in system RPL debugger (hairy) 
  1819.     - a string editor (hairy) 
  1820.     - better GX port of <-LIB-> 
  1821.  
  1822. (all without guaranteeing the implementation) 
  1823.  
  1824. Contact addresses: 
  1825.  
  1826.     Detlef Mueller 
  1827.     Bellerbek 33 
  1828.     D-22559 Hamburg 
  1829.     Germany 
  1830.  
  1831.     Tel:    +49 40 811 92 80    8:00pm - 0:00am CET + 1h ds 
  1832.     FAX:    +49 40 589 58 199 
  1833.     e-mail:    detlef@dmhh.hanse.de 
  1834.  
  1835.  
  1836.     Raymond Hellstern 
  1837.     Liebigstr. 8 
  1838.     D-30163 Hannover 
  1839.     Germany 
  1840.  
  1841.     Tel./FAX +49 511 66 10 11 
  1842.